import App from './App'
import store from '@/store'

// #ifndef VUE3
import Vue from 'vue'
import uView from 'uview-ui'
Vue.use(uView)
let vuexStore = require("@/store/$u.mixin.js");
Vue.mixin(vuexStore);

Vue.filter("DateFormat", (val) => {
	if (!val) {
		return ''
	} else {
		const s = (Number(val) - 621355968000000000) / 10000
		const date = new Date(s)
		const year = date.getFullYear()
		const month = date.getMonth() + 1
		const day = date.getDate()
		return [year, month, day].map(formatNumber).join('-')
	}
})

Vue.filter("NoPassByMobile", (str) => {
	if (null != str && str != undefined) {
		var pat = /(\d{3})\d*(\d{4})/;
		return str.replace(pat, '$1****$2');
	} else {
		return "";
	}
})


import {
	getToken,
	toast,
	loading,
	goWindow,
	goPWindow,
	goNavWindow,
	noPassByMobile
} from '@/utils/util.js'
Vue.prototype.$getToken = getToken
Vue.prototype.$toast = toast
Vue.prototype.$goWindow = goWindow
Vue.prototype.$goPWindow = goPWindow
Vue.prototype.$goNavWindow = goNavWindow



Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	store,
	...App
})
app.$mount()
// #endif



// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
